package com.dragon.refect.error;

/**
 * 字符串中的 + 号拼接，通过编译器编译之后，其实底层就是new StringBuffer().append()
 *
 * @author dragon
 * @since 2019/12/12
 */
public class StringInternTest {

    public static void main(String[] args) {
        String s3 = new String("a") + "b" + "c";
        String s1 = "abc";
        String s2 = "a" + "b" + "c";
        String s5 = new StringBuilder("a").append("b").append("c").toString();
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
    }
}
